﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Text;

namespace PeisongWeb
{
    public partial class buyer_orderCollect : buyerPage
    {
        protected string data = string.Empty;

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (hasPermission("CD", 1))
                {
                    DataTable dt = logic.order.listWithCollect(logic.customer.getCompanyId());

                    StringBuilder csv = new StringBuilder();
                    foreach (DataRow row in dt.Rows)
                    {
                        csv.AppendFormat("{0}-{1},{2},{3},{4:F2},\\n", row["year"], row["month"], row["orderCount"], string.Format("{0:F2}", row["amount"]), row["budgetFee"]);
                    }

                    data = csv.ToString();
                }
                else
                {
                    Library.Script.ClientMsgUrl("没有权限！", "buyer_index.html");
                    return;
                }
            }
        }
    }
}
